﻿/**
*成交删除编号备注
*/
Chenxin.UI.CancelCodeRemarkForm = Chenxin.extend(Chenxin.UI.FormCommon,{
    actionUrl:'/service/logic/ShowRemarkInfo.ashx',
    id:'jqmremark',
    renderTo:'div_remark',
    winCls:'',
    jqmWidth:700,
    defBBtn:true,
    scope:this,
	op:'addCancelRemark',
    createForm: function() {
        return Chenxin.FormCommon.CancelCodeRemarkForm(this.id);
    },
	createGrid:function(){
        return new Chenxin.UI.JsonGrid({
            actionUrl: this.actionUrl + '?op=searchRemark',
            id: 'remark_grid',
            renderTo: this.id+'_grid',
            hasCheckBox:true,
            cellBorder:true,
            scope:this,
			autoLoad:false,
			pageSize:10,
			exportAble:false,
			hasCheckBox:false,
            columns: {
                Status: {
                    head: '类别',
                    width: 120,
                    renderer:function(val,c,row){
						switch(val)
						{
						    case 10:
							    return '流程跟进';
							    break;
							case 20:
							    return '未收跟进';
							    break;
							case 30:
							    return '作废跟进';
							    break;
							default:
							    return '';
							    break;
						}
					}
                },
                RemarkDate: {
                    head: '建档日期',
                    width: 125
                },
                RemarkPerson: {
                    head: '建档人',
                    width: 120
                },
                RemarkInfo: {
                    head: '理由',
                    width: 285
                }
            }
        });
	},
	initFormValidator:function(){
        //理由
        $("#RemarkInfo").formValidator({
            validatorgroup: this.id,
            onshow: "请输入理由！",
            onfocus: "理由为必输项",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "理由不能为空！"
            },
            onerror: "理由不能为空！"
        });
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.CancelCodeRemarkForm.superclass.initComponent.call(this);
		this.grid=this.createGrid();
    }
});

Chenxin.FormCommon.CancelCodeRemarkForm=function(formID){
return '<table style="width:100%;margin:5px 0px;"><tbody><tr><th style="width:80px;text-align:right;">合同编号：</th><td><input style="width:100px;" name="ContractCode" class="inputbox_n fl" id="ContractCode" type="text" readonly="readonly"</td><th style="text-align:right;">地址：</th><td><input style="width:325px;" name="HouseAddress" class="inputbox_n fl" id="Address" type="text" readonly="readonly"/></td></tr><tr><th style="text-align:right;">理由：<span class="isfilled">*</span></th><td colspan="3"><textarea id="RemarkInfo" name="RemarkInfo" class="textarea_n" cols="80" rows="10" class="textarea_n" style=" float:left; width: 500px; height: 60px; padding:5px;"></textarea></td></tr><tr><td colspan="2" ><input type="hidden"  name="ContractId" /><input type="hidden"  name="BusinessType" /></td></tr></tbody></table><div id="'+formID+'_grid"></div>';
};